package instrarbre;

import exprarbre.ASAExpr;
import java.util.HashMap;
import progarbre.ASAProg;

public class ASAReturn extends ASAInstr {

    private ASAExpr expression;

    public ASAReturn(ASAExpr expression) {
        this.expression = expression;
    }

    @Override
    public void interpreter(HashMap<String, Integer> affectation) {
        ASAProg.set(ASAProg.getBottom(), expression.evalue(affectation));
        throw new ReturnException();
    }
}